﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="CARAvailability.aspx.cs" Inherits="CARAvailability"
    MasterPageFile="~/Default.master" EnableViewState="false" %>

<%@ Register Assembly="DevExpress.Web.v9.2, Version=9.2.9.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxCallback" TagPrefix="dxcb" %>
<%@ Register Assembly="DevExpress.Web.ASPxGridView.v9.2, Version=9.2.9.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxGridView" TagPrefix="dxwgv" %>
    
<asp:Content ContentPlaceHolderID="head" ID="hd" runat="server" EnableViewState="false">

    <script src="CARAvailability.js" type="text/javascript"></script>
    <script src="js/LOV.js" type="text/javascript"></script> 
    <script src="js/Datetimepicker.js" type="text/javascript"></script>
    
    <script src="js/FileUpload.js" type="text/javascript"></script>
    
 <%--
    
    <!-- TinyMCE -->

    <script src="js/tiny_mce.js" type="text/javascript"></script>

    <!-- /TinyMCE -->--%>
    <link href="CARAvailability.css" rel="stylesheet" type="text/css" />
</asp:Content>
<asp:Content ContentPlaceHolderID="leftMenu" ID="leftnav" runat="server" EnableViewState="false">
<% Response.Write(GenerateSideMenu()); %>
</asp:Content>
<asp:Content ContentPlaceHolderID="content" ID="ctnCA" runat="server"
    EnableViewState="false">
    <div id="pnlCATitle"></div>
    <div id="pnlCA" runat="server"></div> 
    <fieldset class="m_fs_border" id="fs_CA">
        <legend><a class="lnk" href="javascript:toggle('CA');">CAR Availability</a>
        </legend>
        <dl class="m_fs">
            <div id="div_CA">
            <%Response.Write(CARManager.BuildEditor_AvailabilityFilter()); %>
            <br />
            <div id="divDate" style="display:none;"><% Response.Write(m_dtmStartDate.ToShortDateString() + " - " + m_dtmEndDate.ToShortDateString()); %></div>
            <%
                Response.Write(CARManager.BuildNav());
            %>
            <input type="hidden" id="hStart" value="<% Response.Write(m_dtmStartDate.ToString()); %>" />
            <input type="hidden" id="hEnd" value="<% Response.Write(m_dtmEndDate.ToString()); %>"  />
            
                
            <dxwgv:ASPxGridView ID="dgCA" KeyFieldName="CAR_ID" ClientInstanceName="dgCA_c"
                runat="server" AutoGenerateColumns="false" Width="100%" Font-Size="Small"
                 OnCustomCallback="dgCA_CustomCallback" >
                <Styles Header-HorizontalAlign="Center" AlternatingRow-Enabled="True" Cell-Wrap="true" 
                 Cell-Font-Size="Smaller" Header-Wrap="true" Cell-HorizontalAlign="Center"
                    Header-Font-Size="Smaller" Header-Font-Bold="true">
                    <Header Wrap="True" Font-Size="Smaller" Font-Bold="True">
                    </Header>
                    <AlternatingRow Enabled="True">
                    </AlternatingRow>
                    <Cell Wrap="True" Font-Size="Smaller">
                    </Cell>
                </Styles>
                <SettingsPager PageSize="10">
                </SettingsPager>
                <Settings ShowFilterBar="Visible" ShowFilterRow="true" ShowFilterRowMenu="true" ShowHorizontalScrollBar="true" />
                <SettingsBehavior AllowSort="true" />
                <ClientSideEvents EndCallback="function(s, e) { dgCA_c_EndCallback(e); }" />
                <Columns>
                    <dxwgv:GridViewDataTextColumn FieldName="EMPLOYEE_NAME" Name="CAR" Caption="CAR" Width="25%" 
                     CellStyle-HorizontalAlign="Left">
                        <DataItemTemplate>
                        <%# GridColumnManager.GetCARLinkColumn(Eval("EMPLOYEE_NO").ToString(),Eval("EMPLOYEE_NAME").ToString())%>
                        </DataItemTemplate>
                    </dxwgv:GridViewDataTextColumn>
                    <dxwgv:GridViewDataTextColumn FieldName="MON" Name="MON" Caption="MON" Width="15%">
                        <DataItemTemplate>
                        <%# GetDayColumn(Eval("MON"), Eval("CAR_ID"), "Monday")%>
                        </DataItemTemplate>
                    </dxwgv:GridViewDataTextColumn>
                    <dxwgv:GridViewDataTextColumn FieldName="TUE" Name="TUE" Caption="TUE" Width="15%">
                        <DataItemTemplate>
                        <%# GetDayColumn(Eval("TUE"), Eval("CAR_ID"), "Tuesday")%>
                        </DataItemTemplate>
                    </dxwgv:GridViewDataTextColumn>
                    <dxwgv:GridViewDataTextColumn FieldName="WED" Name="WED" Caption="WED" Width="15%">
                        <DataItemTemplate>
                        <%# GetDayColumn(Eval("WED"), Eval("CAR_ID"), "Wednesday")%>
                        </DataItemTemplate>
                    </dxwgv:GridViewDataTextColumn>
                    <dxwgv:GridViewDataTextColumn FieldName="THU" Name="THU" Caption="THU" Width="15%">
                        <DataItemTemplate>
                        <%# GetDayColumn(Eval("THU"), Eval("CAR_ID"), "Thursday")%>
                        </DataItemTemplate>
                    </dxwgv:GridViewDataTextColumn>
                    <dxwgv:GridViewDataTextColumn FieldName="FRI" Name="FRI" Caption="FRI" Width="15%">
                        <DataItemTemplate>
                        <%# GetDayColumn(Eval("FRI"), Eval("CAR_ID"), "Friday")%>
                        </DataItemTemplate>
                    </dxwgv:GridViewDataTextColumn>
                </Columns>
            </dxwgv:ASPxGridView>
            </div>
            <br />
            <div id="div2_CA"></div>
            
        </dl>
    </fieldset>
    <dxcb:ASPxCallback ID="cbkCA" ClientInstanceName="cbkCA_c" runat="server"
        OnCallback="cbkCA_Callback">
        <ClientSideEvents CallbackComplete="function(s, e) { cbkCA_c_CallbackComplete(e); }" />
    </dxcb:ASPxCallback>
</asp:Content>
